package com.fulihui.information.core.repository.impl;

import com.fulihui.information.biz.conv.ContentCommentsPraiseConv;
import com.fulihui.information.core.repository.ContentCommentsPraiseRepository;
import com.fulihui.information.dal.dataobj.InfoContentCommentsPraise;
import com.fulihui.information.dal.dataobj.InfoContentCommentsPraiseExample;
import com.fulihui.information.dal.mapper.InfoContentCommentsPraiseMapper;
import com.fulihui.information.dto.InfoContentCommentsPraiseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by LM on 2017/4/17.
 */
@Repository
public class ContentCommentsPraiseRepositoryImpl implements ContentCommentsPraiseRepository {

    @Autowired
    private InfoContentCommentsPraiseMapper commentsPraiseMapper;

    @Override
    public boolean insertSelective(InfoContentCommentsPraise record) {
        return commentsPraiseMapper.insertSelective(record) > 0;
    }

    @Override
    public List<InfoContentCommentsPraiseDTO> selectByExample(InfoContentCommentsPraiseExample example) {
        return ContentCommentsPraiseConv.toDTOList(commentsPraiseMapper.selectByExample(example));
    }
}
